package com.nuoniu.sibanyun.entity.production;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * mrp运算结果
 * </p>
 *
 * @author 小啊刚
 * @since 2021-03-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ma_mrp_oper_result")
@ApiModel(value="ErpMrpResult对象", description="mrp运算结果")
public class ErpMrpResult extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "mrp编码")
    @TableField("mrp_code")
    private String mrpCode;

    @ApiModelProperty(value = "建议类型1:采购2:生产3:委外")
    @TableField("bussess_plan")
    private Integer bussessPlan;

    @ApiModelProperty(value = "运算单据类型1:销售2:预测3:生产计划")
    @TableField("voucher_type")
    private Integer voucherType;

    @ApiModelProperty(value = "运算单据id")
    @TableField("voucher_id")
    private Integer voucherId;

    @ApiModelProperty(value = "运算单据号")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "物料id")
    @TableField("inventory_id")
    private Integer inventoryId;

    @ApiModelProperty(value = "物料名称")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "物料编码")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "bom")
    @TableField("bom_id")
    private Integer bomId;

    @TableField(exist = false)
    private String bomName;

    @ApiModelProperty(value = "bom版本号")
    @TableField("bom_version_code")
    private String bomVersionCode;

    @ApiModelProperty(value = "计量单位(单计量使用)")
    @TableField(value = "unit_id")
    private Integer baseUnit;

    @ApiModelProperty(value = "计量单位(单计量使用)")
    @TableField(value = "unit_name")
    private String baseUnitName;

    @ApiModelProperty(value = "计量单位组Id")
    @TableField(value = "unit_group_id")
    private Integer unitGroupId;

    @ApiModelProperty(value = "建议量")
    @TableField("suggest_amount")
    private BigDecimal baseQuantity;

    @ApiModelProperty(value = "运算数量")
    @TableField("operation_number")
    private BigDecimal operationNumber;

    @ApiModelProperty(value = "交货日期")
    @TableField("delivery_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate deliveryDate;

    @ApiModelProperty(value = "累计下达数量")
    @TableField("released_quantity")
    private BigDecimal releasedQuantity;

    @ApiModelProperty(value = "创建日期")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "采购提前期")
    @TableField(exist = false)
    private Integer purchasingLeadTime;

    @ApiModelProperty(value = "生产提前期")
    @TableField(exist = false)
    private String productionLeadTime;

    @ApiModelProperty(value = "开工日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    @TableField(exist = false)
    private LocalDate planBeginDate;

    @ApiModelProperty(value = "完工日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    @TableField(exist = false)
    private LocalDate planEndDate;

    @ApiModelProperty(value = "采购订货日期")
    @TableField(exist = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate acceptDate;

    @ApiModelProperty(value = "采购到货日期")
    @TableField(exist = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate requireDate;
}
